package tirepressuremonitoringsystem;

import java.util.Random;

public class PressureSensor implements ISensor {
    private static final double OFFSET = 16;

    @Override
    public double popNextPsiValue() {
        double pressureTelemetryValue = samplePressure();
        return OFFSET + pressureTelemetryValue;
    }

    private static double samplePressure() {
        // placeholder implementation that simulate a real sensor in a real tire
        Random basicRandomNumbersGenerator = new Random();
        return 6 * basicRandomNumbersGenerator.nextDouble() * basicRandomNumbersGenerator.nextDouble();
    }

}
